package cn.rkylin.oms.system.storage.vo;

import cn.rkylin.oms.system.storage.domain.Stor;

public class StorVO extends Stor {
    private static final String STATUS_CHK = "<input id=\"chkItem\" class=\"chkRule icheck\" style=\"display:none;\"  name=\"chkItem\" type=\"checkbox\" storid=\"%s\" /></input>";
    /**
     * 序列
     */
    private static final long serialVersionUID = 7261100665980740680L;

    /**
     * orderBy子句
     */
    private String orderBy;

    /**
     * 搜索条件
     */
    private String searchCondition;

    /**
     * checkbox
     */
    private String chk;

    /**
     * 更改前仓库名称
     */
    private String updateStorName;

    /**
     * 界面用仓库名称
     */
    private String name;

    public String getName() {
        return getStorName();
    }

    public void setName(String name) {
        this.name = getStorName();
    }

    /**
     * 更改前仓库编码
     */
    private String updateStorCode;
    private String operation;
    private static final String OPERATION_BTN_SELECT = "<button onclick=\"window.top.window.getCurrentIframe().contentWindow.selectStor(\'%s\',\'%s\',\'%s\',this)\" type=\"button\" class=\"btn btn-success btn-xs\"><i class=\"fa fa-check\"></i>&nbsp;选择</button>";

    public String getOperation() {
        StringBuffer opButton = new StringBuffer();
        opButton.append(String.format(OPERATION_BTN_SELECT, this.getStorId(), this.getStorName(), this.getStorCode()));
        this.operation = opButton.toString();
        return this.operation;
    }

    public void setOperation(String operation) {
        this.operation = operation;
    }

    public String getUpdateStorCode() {
        return updateStorCode;
    }

    public void setUpdateStorCode(String updateStorCode) {
        this.updateStorCode = updateStorCode;
    }

    public String getUpdateStorName() {
        return updateStorName;
    }

    public void setUpdateStorName(String updateStorName) {
        this.updateStorName = updateStorName;
    }

    public String getOrderBy() {
        return orderBy;
    }

    public void setOrderBy(String orderBy) {
        this.orderBy = orderBy;
    }

    public String getSearchCondition() {
        return searchCondition;
    }

    public void setSearchCondition(String searchCondition) {
        this.searchCondition = searchCondition;
    }

    public String getChk() {
        return this.chk;
    }

    public void setChk(String chk) {
        this.chk = String.format(STATUS_CHK, this.getStorId()).toString();
    }

}
